<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script>
  let x = 9.656;
  console.log(x.toPrecision())
  console.log(x.toPrecision(2))
  console.log(x.toPrecision(8))
</script>
</html>